﻿<%@ control language="C#" autoeventwireup="true" inherits="UserControls_GuiSMS, App_Web_nauw1oz5" %>
<style type="text/css">
    .auto-style1
    {
        text-align: left;
    }
    .auto-style2
    {
        text-align: left;
        top: 0px;
        width: 286px;
    }
    .auto-style4
    {
        width: 101px;
        text-align: left;
    }
    </style>
    
    <form id="form2" runat="server">
    <div style="text-align: center">
                <table style="width: 100%; height: 375px;">
                    <tr>
                        <td class="auto-style1" colspan="3">Xem theo:
        <asp:TextBox ID="TextBox1" runat="server" Visible="False"></asp:TextBox>
        <br />
        Khoa:
        <asp:DropDownList ID="ddlKhoa" runat="server" AutoPostBack="True" DataSourceID="GetKhoaSqlDataSource" DataTextField="TenKhoa" DataValueField="MaKH" OnSelectedIndexChanged="ddlKhoa_SelectedIndexChanged">
        </asp:DropDownList>
                            <asp:Label ID="Label1" runat="server"></asp:Label>
        <br />
        Lớp:
        <asp:DropDownList ID="ddlLop" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlLop_SelectedIndexChanged">
        </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style2" style="vertical-align: top;" rowspan="10">
        <asp:ListBox ID="lstSV" runat="server" Height="267px" Width="226px" OnSelectedIndexChanged="lstSV_SelectedIndexChanged" AutoPostBack="True"></asp:ListBox>
                        </td>
                        <td style="vertical-align: top" class="auto-style4">
                            Mã Sinh viên:</td>
                        <td style="vertical-align: top" class="auto-style1">
                            <asp:Label ID="lblMaSV" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">Họ và tên:</td>
                        <td class="auto-style1">
                            <asp:Label ID="lblHoTen" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">Ngày sinh:</td>
                        <td class="auto-style1">
                            <asp:Label ID="lblNgaySinh" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">&nbsp;</td>
                        <td class="auto-style1">&nbsp;</td>
                    </tr>
                    <tr>
                        <td class="auto-style4">Số điện thoại 1:</td>
                        <td class="auto-style1">
                            <asp:TextBox ID="txtTelSV1" runat="server" Width="109px"></asp:TextBox>
                            <asp:Label ID="Label2" runat="server" style="color: #FF0000"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">Số điện thoại 2:</td>
                        <td class="auto-style1">
                            <asp:TextBox ID="txtTelSV2" runat="server" Width="109px"></asp:TextBox>
                            <asp:Label ID="Label3" runat="server" style="color: #FF0000"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">&nbsp;</td>
                        <td class="auto-style1">&nbsp;</td>
                    </tr>
                    <tr>
                        <td class="auto-style4">
                            <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Xóa SĐT"  OnClientClick="return confirm('Xóa toàn bộ SĐT của sinh viên này? (Hành động được lưu)');"/>
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Lưu" style="text-align: center" Width="84px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">&nbsp;</td>
                        <td>
                            <asp:Label ID="Label4" runat="server"></asp:Label>
                            <br />
                            <asp:Label ID="Label5" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style4">&nbsp;</td>
                        <td class="auto-style1">&nbsp;</td>
                    </tr>
        </table>
                    <asp:SqlDataSource ID="SMSWebDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SMSWebConnectionString %>" SelectCommand="SELECT * FROM [tbl_1_ChonNguoiNhan] WHERE ([MaND] = @MaND)" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [tbl_1_ChonNguoiNhan] WHERE [tempID] = @original_tempID AND [MaND] = @original_MaND AND [MaSV] = @original_MaSV AND [SoDT] = @original_SoDT AND (([HoTenSV] = @original_HoTenSV) OR ([HoTenSV] IS NULL AND @original_HoTenSV IS NULL))" InsertCommand="INSERT INTO [tbl_1_ChonNguoiNhan] ([MaND], [MaSV], [SoDT], [HoTenSV]) VALUES (@MaND, @MaSV, @SoDT, @HoTenSV)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [tbl_1_ChonNguoiNhan] SET [MaND] = @MaND, [MaSV] = @MaSV, [SoDT] = @SoDT, [HoTenSV] = @HoTenSV WHERE [tempID] = @original_tempID AND [MaND] = @original_MaND AND [MaSV] = @original_MaSV AND [SoDT] = @original_SoDT AND (([HoTenSV] = @original_HoTenSV) OR ([HoTenSV] IS NULL AND @original_HoTenSV IS NULL))">
                        <DeleteParameters>
                            <asp:Parameter Name="original_tempID" Type="Int32" />
                            <asp:Parameter Name="original_MaND" Type="String" />
                            <asp:Parameter Name="original_MaSV" Type="String" />
                            <asp:Parameter Name="original_SoDT" Type="String" />
                            <asp:Parameter Name="original_HoTenSV" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="MaND" Type="String" />
                            <asp:Parameter Name="MaSV" Type="String" />
                            <asp:Parameter Name="SoDT" Type="String" />
                            <asp:Parameter Name="HoTenSV" Type="String" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="TextBox1" Name="MaND" PropertyName="Text" Type="String" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="MaND" Type="String" />
                            <asp:Parameter Name="MaSV" Type="String" />
                            <asp:Parameter Name="SoDT" Type="String" />
                            <asp:Parameter Name="HoTenSV" Type="String" />
                            <asp:Parameter Name="original_tempID" Type="Int32" />
                            <asp:Parameter Name="original_MaND" Type="String" />
                            <asp:Parameter Name="original_MaSV" Type="String" />
                            <asp:Parameter Name="original_SoDT" Type="String" />
                            <asp:Parameter Name="original_HoTenSV" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
        <asp:SqlDataSource ID="GetKhoaSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:dangkyhv_dangkyConnectionString %>" SelectCommand="SELECT [TenKhoa], [MaKH] FROM [Khoa]"></asp:SqlDataSource>
    
    
    </div>
    </form>
